package com.oasistudio.tk;

import android.content.Context;
import android.graphics.drawable.Drawable;

public class CreditPicture {
	public static Drawable get(Context context, int shop_credit){
		int iTempPicID = GetCREDIT_PIC(shop_credit);
		if (iTempPicID != 0) {
			return context.getResources().getDrawable(iTempPicID);
		}else{
			return null;
		}
	}
	public static Drawable get(Context context, String shop_credit){
		return get(context, Integer.parseInt(shop_credit));
	}
	
	private static int GetCREDIT_PIC(int rateSum) {
		if (rateSum == 1)
			return R.drawable.s_red_1;

		else if (rateSum == 2)
			return R.drawable.s_red_2;

		else if (rateSum == 3)
			return R.drawable.s_red_3;

		else if (rateSum == 4)
			return R.drawable.s_red_4;

		else if (rateSum == 5)
			return R.drawable.s_red_5;

		else if (rateSum == 6)
			return R.drawable.s_blue_1;

		else if (rateSum == 7)
			return R.drawable.s_blue_2;

		else if (rateSum == 8)
			return R.drawable.s_blue_3;

		else if (rateSum == 9)
			return R.drawable.s_blue_4;

		else if (rateSum == 10)
			return R.drawable.s_blue_5;

		else if (rateSum == 11)
			return R.drawable.s_cap_1;

		else if (rateSum == 12)
			return R.drawable.s_cap_2;

		else if (rateSum == 13)
			return R.drawable.s_cap_3;

		else if (rateSum == 14)
			return R.drawable.s_cap_4;

		else if (rateSum == 15)
			return R.drawable.s_cap_5;

		else if (rateSum == 16)
			return R.drawable.s_crown_1;

		else if (rateSum == 17)
			return R.drawable.s_crown_2;

		else if (rateSum == 18)
			return R.drawable.s_crown_3;

		else if (rateSum == 19)
			return R.drawable.s_crown_4;

		else if (rateSum == 20)
			return R.drawable.s_crown_5;

		return 0;// R.drawable.png1;
	}

}
